package com.yy.micro.magic.core.result.name;

import org.springframework.util.StringUtils;

public interface NameStrategy {

    String format(String str);

    class NoneNameStrategy implements NameStrategy{
        public static NoneNameStrategy instance = new NoneNameStrategy();
        @Override
        public String format(final String str) {
            return str;
        }
    }

    class LowerNameStrategy implements  NameStrategy{
        public static  LowerNameStrategy instance = new LowerNameStrategy();
        @Override
        public String format(final String str) {
            return StringUtils.isEmpty(str)?str:str.toLowerCase();
        }
    }

    class UpperNameStrategy implements NameStrategy{
        public static UpperNameStrategy instance = new UpperNameStrategy();
        @Override
        public String format(final String str) {
            return StringUtils.isEmpty(str)?str:str.toUpperCase();
        }
    }

    class FirstUpperNameStrategy implements NameStrategy{
        public static  FirstUpperNameStrategy instance = new FirstUpperNameStrategy();
        @Override
        public String format(final String str) {
            return StringUtils.capitalize(str);
        }
    }

    class USCNameStrategy implements NameStrategy{
        public static USCNameStrategy instance = new USCNameStrategy();
        @Override
        public String format(final String str) {
            return com.yy.micro.magic.utils.StringUtils.lowersCase(str);
        }
    }

}
